Skip to content

[Bugfix][Router] Default transcription language to None (auto-detect) - #1070

Open
WaelRabah wants to merge 6 commits into
vllm-project:mainfrom
WaelRabah:fix/audio-transcription-language-default
Open

[Bugfix][Router] Default transcription language to None (auto-detect)#1070
WaelRabah wants to merge 6 commits into
vllm-project:mainfrom
WaelRabah:fix/audio-transcription-language-default

Conversation

@WaelRabah

Copy link
Copy Markdown
Contributor

Summary

route_general_transcriptions was defaulting the transcription language to "en" when the client did not supply one. This forced the backend to transcribe in English even when the model could auto-detect the language.

vLLM's own default for language is None, which leaves language detection to the model. This change aligns the router with that behavior.

Changes

  • src/vllm_router/services/request_service/request.py
    • Default language to None (form.get("language") instead of form.get("language", "en")).
    • Only include the language field in the outbound multipart form data when it is set. When absent, aiohttp.FormData would otherwise encode None as the literal string "None" and send it to the backend as an invalid language.
  • src/tests/test_multipart_proxy.py
    • Update the audio transcription tests to assert the field is absent/None by default.

Testing

src/tests/test_multipart_proxy.py — 4 passed.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the transcription routing to stop defaulting the language parameter to 'en', allowing the backend to auto-detect the language when it is omitted. The corresponding test cases have been updated to reflect this change. Feedback suggests sanitizing the language input to filter out common null-like string values (such as 'none', 'null', or 'undefined') and whitespace, preventing potential backend validation errors from client-side serialization quirks.

Comment thread src/vllm_router/services/request_service/request.py Outdated
WaelRabah and others added 2 commits September 1, 2026 16:45
Stop forcing transcription language to "en" when the client does not
specify one. vLLM's own default is None, letting the model auto-detect
the language. Default to None and omit the language field entirely when
absent so aiohttp does not forward the literal string "None" to the
backend.

Update the multipart proxy test to assert the field is absent (None) by
default.

Signed-off-by: Wael Rabah <47258198+WaelRabah@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Wael Rabah <47258198+WaelRabah@users.noreply.github.com>
@WaelRabah
WaelRabah force-pushed the fix/audio-transcription-language-default branch 2 times, most recently from 14f15ce to df148fe Compare September 2, 2026 13:37
Signed-off-by: Wael Rabah <47258198+WaelRabah@users.noreply.github.com>
@WaelRabah
WaelRabah force-pushed the fix/audio-transcription-language-default branch from df148fe to b12d71a Compare September 2, 2026 14:07
@WaelRabah
WaelRabah force-pushed the fix/audio-transcription-language-default branch 2 times, most recently from 9492583 to 6987c7b Compare September 7, 2026 15:40
Signed-off-by: Wael Rabah <47258198+WaelRabah@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant